using UnityEngine;

public class ExitUI : MonoBehaviour
{
	public UIEventListener yesbtn;

	public UIEventListener moregamebtn;

	public UIEventListener nobtn;

	public Transform uptra;

	public Transform downtra;

	private GameObject uiobj;

	private void Start()
	{
		yesbtn.onClick = onclickYesBtn;
		moregamebtn.onClick = onclickmoregameBtn;
		nobtn.onClick = onclicknoBtn;
	}

	public void init_ui_info()
	{
		if (Platform.IsFullScreenSmallReady() && !Platform.IsAdsFree())
		{
			Platform.ShowFullScreenExitSmall();
			uptra.localPosition = new Vector3(0f, 167f, 0f);
			downtra.localPosition = new Vector3(0f, -182f, 0f);
		}
		else
		{
			uptra.localPosition = new Vector3(0f, 40f, 0f);
			downtra.localPosition = new Vector3(0f, -30f, 0f);
		}
	}

	public void onclickYesBtn(GameObject btn)
	{
		Platform.Instance.OnApplicationQuit();
		//Application.Quit();
		AdManager.Quit();
	}

	public void onclickmoregameBtn(GameObject btn)
	{
		Platform.ShowMoreGames();
	}

	public void onclicknoBtn(GameObject btn)
	{
		disable();
		if (Platform.IsFullScreenSmallShowing())
		{
			Platform.HideFullScreenSmall();
		}
		MonoInstance<AudioController>.instance.play(AudioType.UI_BTN, 0f);
	}

	public void setclosepos()
	{
		uptra.localPosition = new Vector3(0f, 40f, 0f);
		downtra.localPosition = new Vector3(0f, -30f, 0f);
	}

	public void enable()
	{
		if (uiobj == null)
		{
			uiobj = base.gameObject;
		}
		init_ui_info();
		NGUITools.SetActive(uiobj, state: true);
	}

	public void disable()
	{
		MenuBackController.instance.BackMenuUIstate();
		NGUITools.SetActive(uiobj, state: false);
	}
}
